#include <iostream>
#include <string>

class BankAccout
{
public:
    BankAccout(std::string account);
    void deposit(double amount);
    void withdraw(double amount);
    void display();

private:
    std::string Account;
    double balance;
};

BankAccout::BankAccout(std::string account):balance(0)
{
    Account = account;
}

void BankAccout::deposit(double amount)
{
    balance = balance + amount;
}

void BankAccout::withdraw(double amount)
{
    if (balance - amount >= 0)
        balance = balance - amount;
    else std::cout<<"余额不足!\n";
}

void BankAccout::display()
{
    std::cout<<std::endl;
    std::cout << "账户名:" << Account << "\n"<< "余额:" << balance << std::endl;
    std::cout<<std::endl;
}

int main()
{
    BankAccout a("XuanSong");
    a.display();
    a.deposit(500);
    a.display();
    a.withdraw(299.5);
    a.display();
    a.withdraw(300);
    return 0;
}